<html>
<head>

<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="neat.css">
<link rel="stylesheet" href="font.css">
<style>

</style>
<title>联盟后台招商生产工具V1.0</title>
<meta name="keywords" content="淘客直播,淘客直播平台,淘客平台">
<meta name="description" content="专注淘客直播的专业直播平台">
<link rel="shortcut icon" type="image/x-icon" href="logo.ico">

</head>
<body>


<?php

require_once('api/TopSdk.php');

if (empty($_POST["value"])) {
	$url = 'https://detail.tmall.com/item.htm?id=554178402763';
} else {
$url = $_POST["value"]; 
}
  preg_match_all("/id=.*?&|id=.*/", $url, $array);
  preg_match_all("/[0-9]+/", $array[0][0], $arr);

$num = $arr[0][0];

$appkey = 23410561;
$secret = '1e9a20c64278e51bd09dc950e6ba0f01';


$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TbkItemInfoGetRequest;
$req->setFields("num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,volume,zk_final_price,nick,provcity,item_url");
$req->setNumIids($num);
$resp = $c->execute($req);

if (empty($resp->results->n_tbk_item)) {
	echo "<script>alert('该商品没有加入阿里妈妈')</script>";
	

}

else{

//echo $num;
//var_dump($resp);

//echo($resp->results->n_tbk_item->title);
}
 


?>
 <script>
       function go() {
             var inputValue = document.getElementById("url_go").value;
            console.log(inputValue);
          alert(inputValue);
       }
</script>


<div class="table-maker">
<div class="table-go">
<form method="post" action="">
<input type="text"  class="input"  name="value" style="width: 810px;" placeholder="请输入完整链接，自动解析，支持任意天猫、淘抢购、聚划算、C店链接，不支持没有推广的链接。" value="" maxlength="100" id="url_go">
<input type="submit" name="send" value="解析"/ style="height: 30px;width: 136px;">
</form>
</div>
</div>


<div class="block-head list-head" p-id="223"><ul class="tab clearfix" p-id="224"><li class="active" p-id="225" data-spm-anchor-id="a219t.7900221/14.1998910419.i3.290575a5mEcDRG">招商商品<small p-id="227">(<span p-id="229"><?php echo rand(100,196) ?></span>)</small></li></ul></div>
<div class="table-container" p-id="2827">
	<div class="toolbar clearfix" p-id="2828">
		<span class="input-search fr" p-id="2829"><input type="text" mx-keyup="search" class="input" placeholder="请输入关键词搜索" value="" maxlength="100" p-id="2830"></span>
		<div class="dropdown" data-moduleid="components/dropdown" data-clientid="30">
			<button class="btn btn-default dropdown-toggle" type="button" value="2" bx-click="toggle()">
			<span class="dropdown-toggle-label">已报名的商品</span>
			<!-- <span class="caret"> -->
			<span class="caret_custom caret_brixfont"><!-- 保留 caret_brixfont 是为了向后兼容，在下个版本中移除  -->
			<span class="brixfont down"></span><!-- 向下 &#xe623; -->
			<span class="brixfont up"></span><!-- 向上 &#xe62e;-->
			</span>
			</button>
			<div class="dropdown-menu-wrapper">
				<ul class="dropdown-menu">
					<li class="">
					<a href="javascript:;" value="" bx-click="select()" title="所有商品" data-spm-anchor-id="a219t.7900221/14.1998910419.315">
					<span>所有商品</span>
					</a>
					</li>
					<li class="active">
					<a href="javascript:;" value="2" bx-click="select()" title="已报名的商品" data-spm-anchor-id="a219t.7900221/14.1998910419.316">
					<span>已报名的商品</span>
					</a>
					</li>
				</ul>
			</div>
		</div>
		<select bx-name="components/dropdown" auditstatus="2" p-id="2831" data-clientid="30" style="display: none;">
			<option value="" selected="true" p-id="2832">所有商品</option>
			<option value="2" p-id="2834">已报名的商品</option>
		</select>
	</div>
	<div class="table-with-border" p-id="2836">
		<div class="table-head" p-id="2837">
			<div class="table-head-fix" bx-name="app/exts/scrollfix/index" bx-options="{offset:0}" p-id="2838" data-clientid="28" style="position: static; top: auto; left: auto; width: auto;">
				<table class="table" p-id="2839">
				<thead p-id="2840">
				<tr class="" p-id="2841">
					<th class="left" p-id="2842" data-spm-anchor-id="a219t.7900221/14.1998910419.i5.543d75a5Zzofny">
						商品信息
					</th>
					<th class="left" width="90" p-id="2844">
						价格
					</th>
					<th class="left" width="120" p-id="2846">
						佣金比率
					</th>
					<th class="center" width="90" p-id="2848">
						操作
					</th>
				</tr>
				</thead>
				</table>
			</div>
		</div>
		<table class="table" p-id="2850">
		<tbody p-id="2851">
		<tr p-id="5134" id="mx_n_89">
			<td class="left" p-id="5135">
				<div class="block-list-group tag-wrap" p-id="5136" data-spm-anchor-id="a219t.7900221/14.1998910419.i3.543d75a5Zzofny">
					<div class="img" p-id="5137">
						<a target="_blank" class="list-item-img img-loaded" href="<?php echo($resp->results->n_tbk_item->item_url); ?>" p-id="5138" data-spm-anchor-id="a219t.7900221/14.1998910419.317"><span class="empty-icon-bg" p-id="5139"></span><img src="<?php echo($resp->results->n_tbk_item->pict_url); ?>" p-id="5140" data-spm-anchor-id="a219t.7900221/14.1998910419.i8.543d75a5Zzofny"><!--deleted-5141--></a>
					</div>
					<ul class="attr" p-id="5142">
						<li class="title overflow_dotted" p-id="5143"><a target="_blank" href="<?php echo($resp->results->n_tbk_item->item_url); ?>" p-id="5144" data-spm-anchor-id="a219t.7900221/14.1998910419.318"><span p-id="5145" data-spm-anchor-id="a219t.7900221/14.1998910419.i7.543d75a5Zzofny"><?php echo($resp->results->n_tbk_item->title); ?></span></a></li>
						
						<?php if($resp->results->n_tbk_item->user_type == 1) {  ?>
						<li class="summary" p-id="5146"><span class="tags-container" p-id="5147"><!--deleted-5148--><a href="javascript:void(0);" class="tag tag-tmall" p-id="5149" data-spm-anchor-id="a219t.7900221/14.1998910419.319"></a></span></li>
						<?php } else { ?>
						<div style="height:28px;">
						
						
						</div>
						<?php } ?>
						
						<li class="shop-info overflow_dotted" _ie_fix_="" mx-mouseenter="showShopInfo(3190734924,1)" mx-mouseleave="hideShopInfo(3190734924)" p-id="5150"><span class="pubfont icon-dianpu shop-icon valign-m" p-id="5151"></span><a vclick-ignore="true" class="valign-m" title="点击进入店铺推广详情页" href="/myunion.htm?#!/promo/self/shop_detail?userNumberId=3190734924" data-spm-click="gostr=/alimama.11;locaid=d8672f020" target="_blank" p-id="5152" data-spm-anchor-id="a219t.7900221/14.1998910419.d8672f020"><span p-id="5153"><?php echo($resp->results->n_tbk_item->nick); ?></span></a><span class="valign-m" p-id="5154"><a class="ui-ww ui-ww-online" href="http://www.taobao.com/webww/ww.php?ver=3&amp;siteid=cntaobao&amp;status=1&amp;charset=utf-8&amp;touid=%E9%87%91%E5%A5%A2%E9%A5%B0%E5%93%81%E6%97%97%E8%88%B0%E5%BA%97" data-account="金奢饰品旗舰店" p-id="5155" target="_blank" data-spm-anchor-id="a219t.7900221/14.1998910419.321"></a></span></li>
					</ul>
				</div>
			</td>
			<td class="left" width="90" p-id="5156">
				<p class="number number-16 mb5" p-id="5157">
					<span class="yuan" p-id="5159">￥</span><span class="integer" style="font-size:12px;"><?php echo($resp->results->n_tbk_item->zk_final_price); ?></span>
				</p>
				<p class="color-l" p-id="5167">
					月销<span p-id="5169"><?php echo($resp->results->n_tbk_item->volume); ?></span>
				</p>
			</td>
			<td class="left pr" width="120" p-id="5170">
				<!--deleted-5171-->
				<div p-id="5172">
					<!--deleted-5173-->
					<div p-id="5174">
						<p class="mb5" p-id="5175">
							<strong class="color-brand" p-id="5176">报名后：<span p-id="5178">30</span>%</strong>
						</p>
						<p class="color-l" p-id="5180">
							报名前：<span p-id="5182">30</span>%
						</p>
					</div>
				</div>
			</td>
			<td class="center" width="90" p-id="5184">
				<div class="operation" p-id="5185">
					<!--deleted-5186--><!--deleted-5187--><button class="btn btn-gray btn-small" mx-click="itemCode(564479224621,3)" data-spm-click="gostr=/alimama.11;locaid=d79939b05" p-id="5188">立即推广</button>
				</div>
			</td>
		</tr>
		
		</tbody>
		</table>
		<!--deleted-5132-->
	</div>
	<div bx-name="app/exts/pagination/pagination" data-total="2" data-cursor="1" data-limit="40" class="hide" p-id="5133" data-clientid="31">
		<div class="pagination-new">
			<div class="pagination">
				<a href="javascript: void(0);" class="btn-first btn btn-xlarge btn-unreach" bx-click="moveTo(0)" data-spm-anchor-id="a219t.7900221/14.1998910419.285"><span class="pubfont"></span>上一页</a><!-- Previous --><a href="javascript: void(0);" class="btn btn-xlarge btn-current" data-spm-anchor-id="a219t.7900221/14.1998910419.286">1</a><a href="javascript: void(0);" bx-click="moveTo(2)" class="btn btn-xlarge btn-white" data-spm-anchor-id="a219t.7900221/14.1998910419.287">2</a><a href="javascript: void(0);" bx-click="moveTo(3)" class="btn btn-xlarge btn-white" data-spm-anchor-id="a219t.7900221/14.1998910419.288">3</a><a href="javascript: void(0);" bx-click="moveTo(4)" class="btn btn-xlarge btn-white" data-spm-anchor-id="a219t.7900221/14.1998910419.289">4</a><a href="javascript: void(0);" bx-click="moveTo(5)" class="btn btn-xlarge btn-white" data-spm-anchor-id="a219t.7900221/14.1998910419.290">5</a><a href="javascript: void(0);" class="btn-last btn btn-xlarge btn-white" bx-click="moveTo(2)" data-spm-anchor-id="a219t.7900221/14.1998910419.291">下一页<span class="pubfont"></span></a><!-- Next -->
			</div>
			<div class="go">
				<span class="n">到第</span><input class="input" type="text" value="2"><span class="n">页</span><button class="btn btn-small btn-white" bx-click="goToPage()">确定</button>
			</div>
		</div>
	</div>
</div>


</body>
</html>